#include <iostream>
#include <functional>
using namespace std;
typedef function<void(int,string,uint16_t)> func;
class Task
{
public:
    Task()
    {}
    Task(int sock,string ip,uint16_t port,func fun)
    :_sock(sock)
    ,_ip(ip)
    ,_port(port)
    ,_func(fun)
    {}
    // Task(const Task& task)
    // {
    //     _x = task._x;
    //     _y = task._y;
    //     _func = task._func;
    // }
    void operator()()
    {
        _func(_sock,_ip,_port);
    }
public:
//private:
    int _sock;
    string _ip;
    uint16_t _port;
    func _func;
};